
package interfaces;

import java.awt.Dimension;
import java.awt.Toolkit;

/**
 *
 * @author WILFREDO
 */
public class GuiError extends javax.swing.JDialog {

    /** Creates new form GuiErrorLogin */
    public GuiError(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
        this.pack();
        Dimension pantalla = Toolkit.getDefaultToolkit().getScreenSize();
        Dimension ventana = this.getSize();
        this.setLocation((pantalla.width - ventana.width) / 2,(pantalla.height - ventana.height) / 2);

    }
    
    public GuiError(String a,java.awt.Dialog parent, boolean modal) {
        super(parent, modal);
        
        initComponents();
        this.ErrLabMen.setText(a);
        this.pack();
        Dimension pantalla = Toolkit.getDefaultToolkit().getScreenSize();
        Dimension ventana = this.getSize();
        this.setLocation((pantalla.width - ventana.width) / 2,(pantalla.height - ventana.height) / 2);
      

    }
    public void colocarMensaje (String mensaje)
    {
        this.ErrLabMen.setText(mensaje);
    }
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        ErrBotAce = new javax.swing.JButton();
        ErrLabMen = new javax.swing.JLabel();
        ErrLabIma = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setModal(true);
        setResizable(false);

        ErrBotAce.setText("Aceptar");
        ErrBotAce.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ErrBotAceActionPerformed(evt);
            }
        });
        ErrBotAce.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                ErrBotAceKeyPressed(evt);
            }
        });

        ErrLabMen.setFont(new java.awt.Font("Tahoma", 0, 12));
        ErrLabMen.setText("Usuario o Contraseña invalida");

        ErrLabIma.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/error.png"))); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(39, 39, 39)
                .addComponent(ErrLabIma, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(ErrLabMen))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(14, 14, 14)
                        .addComponent(ErrBotAce)))
                .addContainerGap(25, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(24, Short.MAX_VALUE)
                .addComponent(ErrLabMen)
                .addGap(18, 18, 18)
                .addComponent(ErrBotAce)
                .addContainerGap())
            .addGroup(layout.createSequentialGroup()
                .addComponent(ErrLabIma, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(29, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void ErrBotAceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ErrBotAceActionPerformed
        dispose();
        // TODO add your handling code here:
    }//GEN-LAST:event_ErrBotAceActionPerformed

    private void ErrBotAceKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_ErrBotAceKeyPressed
        dispose();
        
    }//GEN-LAST:event_ErrBotAceKeyPressed
  
    
   
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton ErrBotAce;
    private javax.swing.JLabel ErrLabIma;
    private javax.swing.JLabel ErrLabMen;
    // End of variables declaration//GEN-END:variables
}
